using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Core_HGUI_PrefabAsset_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Core.HGUI.PrefabAsset);

            field = type.GetField("name", flag);
            app.RegisterCLRFieldGetter(field, get_name_0);
            app.RegisterCLRFieldSetter(field, set_name_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_name_0, AssignFromStack_name_0);
            field = type.GetField("models", flag);
            app.RegisterCLRFieldGetter(field, get_models_1);
            app.RegisterCLRFieldSetter(field, set_models_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_models_1, AssignFromStack_models_1);
            field = type.GetField("tables", flag);
            app.RegisterCLRFieldGetter(field, get_tables_2);
            app.RegisterCLRFieldSetter(field, set_tables_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_tables_2, AssignFromStack_tables_2);
            field = type.GetField("Version", flag);
            app.RegisterCLRFieldGetter(field, get_Version_3);
            app.RegisterCLRFieldSetter(field, set_Version_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_Version_3, AssignFromStack_Version_3);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Core.HGUI.PrefabAsset());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Core.HGUI.PrefabAsset[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_name_0(ref object o)
        {
            return ((huqiang.Core.HGUI.PrefabAsset)o).name;
        }

        static StackObject* CopyToStack_name_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.PrefabAsset)o).name;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_name_0(ref object o, object v)
        {
            ((huqiang.Core.HGUI.PrefabAsset)o).name = (System.String)v;
        }

        static StackObject* AssignFromStack_name_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @name = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Core.HGUI.PrefabAsset)o).name = @name;
            return ptr_of_this_method;
        }

        static object get_models_1(ref object o)
        {
            return ((huqiang.Core.HGUI.PrefabAsset)o).models;
        }

        static StackObject* CopyToStack_models_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.PrefabAsset)o).models;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_models_1(ref object o, object v)
        {
            ((huqiang.Core.HGUI.PrefabAsset)o).models = (huqiang.Data.FakeStruct)v;
        }

        static StackObject* AssignFromStack_models_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Data.FakeStruct @models = (huqiang.Data.FakeStruct)typeof(huqiang.Data.FakeStruct).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Core.HGUI.PrefabAsset)o).models = @models;
            return ptr_of_this_method;
        }

        static object get_tables_2(ref object o)
        {
            return ((huqiang.Core.HGUI.PrefabAsset)o).tables;
        }

        static StackObject* CopyToStack_tables_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.PrefabAsset)o).tables;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_tables_2(ref object o, object v)
        {
            ((huqiang.Core.HGUI.PrefabAsset)o).tables = (huqiang.Data.FakeStruct[])v;
        }

        static StackObject* AssignFromStack_tables_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Data.FakeStruct[] @tables = (huqiang.Data.FakeStruct[])typeof(huqiang.Data.FakeStruct[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Core.HGUI.PrefabAsset)o).tables = @tables;
            return ptr_of_this_method;
        }

        static object get_Version_3(ref object o)
        {
            return ((huqiang.Core.HGUI.PrefabAsset)o).Version;
        }

        static StackObject* CopyToStack_Version_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.PrefabAsset)o).Version;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Version_3(ref object o, object v)
        {
            ((huqiang.Core.HGUI.PrefabAsset)o).Version = (System.String)v;
        }

        static StackObject* AssignFromStack_Version_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @Version = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Core.HGUI.PrefabAsset)o).Version = @Version;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Core.HGUI.PrefabAsset();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
